/*
 ============================================================================
 Name		: PosReader.h
 Author	  : Den Grigorenko
 Copyright   : Copyright (c) 2008 Den123
 Description : Declares CPositionReader - this class allows read location data
 ============================================================================
 */

#ifndef __POS_READER_H__
#define __POS_READER_H__

#include <epos_cposlandmarkdatabase.h> // CPosLandmark
#include <tlmkitemiddbcombiinfo.h>     // TLmkItemIdDbCombiInfo

#include <lbs.h>
#include <lbspositioninfo.h> 
#include <lbssatellite.h>

class MPositionReaderObserver
{
	public:
	   virtual void ReadingComplete( TPositionInfoBase& aPosInfo ) = 0;
	   virtual void ReadingError( TInt aErrorNo ) = 0;
};

class CPositionReader : public CActive
{
   public:	
      static CPositionReader* NewL( MPositionReaderObserver* anObserver );
      ~CPositionReader();
      
      // requests
      void ReadPosInfo();
      void ReadCourseInfo();
      void ReadSatelliteInfo();

      // data access      
      TPositionInfo& PosInfo();
      const TPositionCourseInfo& CourseInfo();
      const TPositionSatelliteInfo& SatelliteInfo();
      
	      
   public: // from CActive	          
      void RunL();
      void DoCancel();
	  
   private:
      // C++ constructor
      CPositionReader();
      // second phase constructor
      void ConstructL();
      // issue async request
      void ReadInternal( TPositionInfoBase& anInfo );
	  
   private:	   	   
      // client observer
      MPositionReaderObserver* iObserver;

      // location acquisition classes
      RPositionServer iServer;
      RPositioner iPositioner;
	  
      TPositionInfoBase*     iCurInfo;
      TPositionInfo          iPositionInfo;
      TPositionCourseInfo    iPositionCourseInfo;
      TPositionSatelliteInfo iPositionSatelliteInfo;	  
};




#endif // __POS_READER_H__
